package cn.tao.org.service.impl;


import cn.tao.base.service.IBaseService;
import cn.tao.base.service.impl.BaseServiceImpl;
import cn.tao.org.domain.Employee;
import cn.tao.org.mapper.EmployeeMapper;
import cn.tao.org.query.EmployeeQuery;
import cn.tao.org.service.IEmployeeService;
import cn.tao.utils.QueryResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService{

    @Autowired
    private EmployeeMapper employeeMapper;




    /**
     * 批量删除，接收一个long类型的数组
     * @param ids
     */
    @Override
    @Transactional
    public void batchDelete(Long[] ids) {
        employeeMapper.batchDelete(ids);
    }

    /**
     * 修改状态
     * @param id
     */
    @Override
    @Transactional
    public void uptState(Long id) {
        Employee employee = employeeMapper.loadById(id);
        employee.setState(0);
        employeeMapper.update(employee);
    }
}
